<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core">

    <body>

        <ui:composition >
            <p:panel >
                <h:panelGrid columns="2" >
                    <p:commandButton value="Novo Insert" 
                                     icon="iconNovo"
                                     id="btnNovo"
                                     action="#{gravadoraBean.novo()}"
                                     update=":geral:pnlProcesso"/>

                </h:panelGrid>
            </p:panel>

            <br/>
            <p:dataTable id="dtGravadora" var="gravadora" value="#{gravadoraBean.generosMusicais}"
                             paginator="true" rows="15"
                             style="width: auto; height: auto"
                             emptyMessage="Sem Registros">
                    <p:column headerText="Nome ">
                        <h:outputText value="#{gravadora.nomeGravadora}"/>
                    </p:column>
                    <p:column headerText="Opções" width="60">
                        <p:commandButton update=":geral:pnlProcesso"
                                         value="Abrir Gravadora" 
                                         action="#{gravadoraBean.irSelo}">
                            <f:setPropertyActionListener 
                                target="#{gravadoraBean.gravadora}" 
                                value="#{gravadora}"/>
                        </p:commandButton>
                        <p:commandButton 
                                         value="Excluir Gravadora" 
                                         action="#{gravadoraBean.irExcluirGravadora()}"
                                     update=":geral:mensagem, :geral:pnlProcesso">
                            <f:setPropertyActionListener 
                                target="#{gravadoraBean.gravadora}" 
                                value="#{gravadora}"/>
                        </p:commandButton>
                    </p:column>
                </p:dataTable>
        </ui:composition>

    </body>
</html>